//
//  CJControl.h
//  TMSDriver
//
//  Created by mac on 2019/2/12.
//  Copyright © 2019年 zhuchongjin. All rights reserved.
//

#import <Foundation/Foundation.h>
/**
 *   支付方式
 */
typedef NS_ENUM(NSUInteger, CJPaymentType) {

//  网商支付
    CJMybankPay = 0,
//    阿帕中台支付
    CJArpaPay,
//    中信云企付
    CJZhongXinPay,
    
//   默认支付  无用
    CJDefaultPay
    
};

@interface CJControl : NSObject
+(void)clearAllUserDefaultsData;

#pragma mark ----------判断是否第一次登陆成功
+ (BOOL)getIsFirstLogInSucess;

#pragma mark ----------登录返回信息处理-------

//// 登陆
+ (BOOL)isLogin;
///// code  base64 加密
//+ (NSString *)getCodeWithBase64;


/// 获取系统参数设置s
+ (NSString *)getSecondUploadDetail;
+ (NSString *)getBranchCode;

/// 获取手机号
+ (NSString *)getServePhoneNum;
+ (NSString *)getDeviceUUID;

//

/// 是否是企业用户
+ (BOOL)getIsCompany;

#pragma mark ------- PartyGroupDefault

/// 获取客服电话
+ (NSString *)getCustomerServicePhone;

/// 获取全国客服电话
+ (NSString *)getCustomerServiceqgPhone;

+ (NSString *)getPartyCode;

/// 登陆是否需要 短信验证   yes 需要 其他均不需要
+ (BOOL)getIsLoginNeedSMS;

/// 是否隐藏分机构
+ (BOOL)getHideBranche;
#pragma mark -------- 获取盐
+ (NSString *)getDefaultSalt;

#pragma mark ----userCenter

///是否独立核算:0否/1是 ,
+ (NSInteger )getIsIndependentCheckout;
/// 获取登陆电话
+ (NSString *)getLogInPhoneNum;
/// 是否是 企业员工
+ (BOOL)getIsCompanyStaff;
// 企业和企业下的发货人
+ (BOOL)getIsCompanyAndStaff;
/// 税务开关 0关闭 1开启
+ (BOOL)getIsTax;

/// 电子签章 是否通过短信
+ (BOOL)getElecSignTypeByAouthCode;
/// 使用地图选点
+ (BOOL)getSelectAdressByAmap;

/// 证件到期预警
+ (BOOL)getIdCardDueWarn;

/// 获取认证状态数值
+ (NSInteger )getAccountAuthStatus;
/// 身份证是否已经到期  1 是 0否
+ (BOOL)getIdCardDateHasDue;
///获取本地储存 强提醒是否展示
+ (BOOL)getStrongReminderShow;
/// 展示网商支付
+ (BOOL)getShowMyBank;

/// 展示网商和银行钱包信息
+ (BOOL)getShowAccounWallet;

///// 获取支付类型
//+ (CJPaymentType )getPaymentType;

/// （企业）员工是否隐藏核算按钮  只有  configValue == 0  返回YES隐藏其他均展示
+ (BOOL)getIsHideAcccountPrice;

/// （企业）员工是否货主打款核算按钮  只有  configValue == 0  返回YES隐藏其他均展示
+ (BOOL)getIsHideApplyRemit;
#pragma mark ----- 个人中心 余额支付免验状态
/// 个人中心 余额支付免验状态
+ (NSString *)getAccountBalanceVisafreeAuthStatus;
/// 是否调用授权接口
+ (BOOL)getWhetherCallVisaFreeApi;
//展示 免验授权
+ (BOOL)getShowAccountBalanceVisafree;


#pragma mark - base64加密
+ (NSString *) base64:(NSString *) input;
#pragma mark - md5加密
+ (NSString *) md5:(NSString *) input;

/**
 十进制转换十六进制
  
 @param decimal 十进制数
 @return 十六进制数
 */
+ (NSString *)getHexByDecimal:(NSInteger)decimal;

+ (NSString *)getImgFilePath:(UIImage *)img;


///// 获取当前时间
///// @param dateTimeType <#dateTimeType description#>
//+ (NSString *)getCurrentTimesType:(CJDateTimeMode )dateTimeType;
//
///// 时间戳 毫秒
//+(NSString *)getNowTimeTimestamp;

+(NSString *)convertToJsonData:(NSArray *)dict;
+(NSString *)convertToJsonDataFromDic:(NSDictionary *)dict;
+(NSString *)convertToJsonDataFromArray:(NSArray *)dict;


/// 分割字符串
/// @param str <#str description#>
/// @param sign <#sign description#>
+ (NSArray *)componentsSeparatedByString:(NSString *)str withSign:(NSString *)sign;

///  去空格 
/// @param str <#str description#>
+ (NSString *)stringByReplacingOccurrencesOfString:(NSString *)str;

/// 打电话
/// @param phone <#phone description#>
+ (void)clickPhoneWithPhoneNum:(NSString *)phone;


/// 三目 判断值
/// @param idx <#str description#>
+ (NSString *)getThreeUnaryValueStr:(id)idx;

+ (BOOL)getIsEmpty:(id)idx;
/**
 *  通过 CAShapeLayer 方式绘制虚线
 *
 *  param lineView:       需要绘制成虚线的view
 *  param lineLength:     虚线的宽度
 *  param lineSpacing:    虚线的间距
 *  param lineColor:      虚线的颜色
 *  param lineDirection   虚线的方向  YES 为水平方向， NO 为垂直方向
 **/
+ (void)drawLineOfDashByCAShapeLayer:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor lineDirection:(BOOL)isHorizonal;

//+ (UIImage *)addWatermarkToPicture:(UIImage *)image withLoaction:(NSString *)locationStringl;
+ (UIImage *)watermardImageWithImage:(UIImage *)originalImage text:(NSString *)text watermardScale:(CGFloat)scale;
+ (UIViewController *)getCurrentViewController;

/// 手机号加星号
/// @param originalStr <#originalStr description#>
/// @param startLocation <#startLocation description#>
/// @param lenght <#lenght description#>
+(NSString *)replaceStringWithAsterisk:(NSString *)originalStr startLocation:(NSInteger)startLocation lenght:(NSInteger)lenght;

+ (BOOL)getUIWithNew;

@end
